const fs = require('fs')
const path =require('path')
const dayjs = require('dayjs')
function news(){
    let fliepath = path.join(__dirname,'../../data/news.json')
    const data = JSON.parse(fs.readFileSync(fliepath,'utf-8'))
   
    data.map(el => {
       el.publish_time = dayjs(el.publish_time).format('YYYY-MM-DD HH-mm-ss')
      
    })
    return data
    //console.log(data)
}
module.exports ={
    news
}